Repository navigation
feat(id): Notion importer slice 2 — page/block core, link rewriting, files (#13522) - #13631
Merged
Merged
Conversation
added 4 commits
November 23, 2026 17:47
…files Design #6436 slice 2 (#13522), building on slice 1's manifest + inventory (#8419) in id-import-notion: - Identity pass (Manifest::assign_page_identities): assigns note IDs to every inventoried page before any content converts (design §3 two-pass rule); recorded assignments never change (§6.1). - Page/block core (§2.1, §2.5): block trees are fetched fresh with sibling order preserved and converted to the revision content form for the clean classes; child pages become typed references, never inlined content. Every block is classified clean/degraded/ unsupported; degraded and unsupported blocks are preserved verbatim with children embedded — nothing is dropped. - Link rewriting (§3): page links, mentions, and block links resolve through the manifest identity map to typed references; links outside the import set stay verbatim and are counted externalised. - Files (§4): file blocks are fetched during the run through an injected FileFetcher, stored as BLAKE3-256 content-addressed blobs (duplicate bytes stored once), recorded in the manifest's new file_blobs map; an unfetchable file degrades its page with a named reason and never aborts the import. Expiring file URLs are never persisted (§6.5). New dependency: blake3 1 (already in the workspace lock via iroh) — blob identity must match the model's raw-blake3-256 profile. Tests: tests/recorded_content.rs over recorded API fixtures (§8 checks 2 and 6 subset, check 3 at conversion level) plus unit tests for block classification and Notion URL extraction.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13522. Part of #6513 (the Notion importer programme under the #6436 design,
doc/2026-11-10_design_id6436.md); slices 3–5 are filed as #13523, #13524, #13525.What landed
Slice 2 of the importer design — page/block core + link rewriting + files — in
pkgs/id/crates/id-import-notion, following slice 1's architecture (#8419: injected boundaries, offline recorded fixtures, no credentials persisted):Manifest::assign_page_identities, design §3/§6.1): assigns a destination note ID to every inventoried page before any content converts, so forward references resolve. Recorded assignments never change; an empty or duplicate minted ID fails the pass.SpanLink::Note+ the page's reference list); block links (#<block-uuid>) carry the block selector when the block is inventoried under the linked page. A link or mention whose target is outside the import set stays verbatim and is counted inexternalisedfor the fidelity report.FileFetcher; blobs are keyed by BLAKE3-256 (the model'sraw-blake3-256profile), duplicate bytes are stored once, and the manifest gains afile_blobsmap (source block ↔ blob,#[serde(default)]so slice-1 manifests still load). An unfetchable file degrades its page with a named reason (expiring URL stripped from it) and never aborts the import. Staged progress advances Files → Content → References without rewinding (§6.3).Deliberately out of this slice
child_databaseblock already emits its reference here with the note ID left for slice 3.block_id_to_identity; slice 4 registers them when it converts the structure.NotionApiboundary has no page-retrieve method to refresh their expiring URLs with; noted on id: implement Notion importer slice 4: comments + degradation completion + export reader (design #6436) #13524 for the slice that extends the boundary.Tests
Remote dispatch only:
cargo fmt --manifest-path pkgs/id/Cargo.toml -p id-import-notion -- --check && cargo test --manifest-path pkgs/id/Cargo.toml -p id-import-notion— the "Execute target command" step of run 45240072029 (developing-today/fleet fleet-command, reffelix/6513-notion-slice-2@ 45dab3a) completed success: the full crate suite is green — 15 unit tests (11 slice-1 + 4 new) and 3 integration tests (1 slice-1 + 2 new). Earlier runs on the way: 45231569263 (fmt diffs, fixed), 45232462022 (oneOutcomemove error, fixed).tests/recorded_content.rs(new): recorded-fixture conversion of two pages exercising nested lists, to-do/code/bookmark payloads, a child page, internal + mention + block links, an externalised link, duplicate file bytes (one blob, two manifest entries), an unfetchable file (page degraded, import not aborted), a degraded toggle and an unknown block type (both verbatim). Asserts the §8 check 2/6 subsets, no file URL or secret in the persisted manifest or content (§6.5), and check 3 at conversion level: re-running assignment + conversion over the unchanged corpus assigns nothing and reproduces identical content, references, and manifest maps.New dependency
blake3 = "1"forid-import-notion— blob identity must be the model'sraw-blake3-256content digest. blake3 is already in the workspace lock (via iroh); the lock change is the one dependency line on this crate. No other new dependencies; no schedules touched.{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-23T18:53:57Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "76bbec72135cee7bd837984b0cd283ae295766e0" }, "auth_subject": "felix", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.